package com.allwees.bs.c.module.order.context.compute;

import com.allwees.bs.c.module.order.context.bo.CouponComputeBo;
import com.allwees.bs.c.module.order.context.bo.UserCouponBo;

public abstract class ComputeHandler {

    protected ComputeHandler nextHandler;

    public abstract void handler(UserCouponBo coupon, CouponComputeBo request);

    protected void doNext(UserCouponBo coupon, CouponComputeBo request) {
        if (nextHandler != null) {
           nextHandler.handler(coupon,request);
        }
    }

    public ComputeHandler setNextHandler(ComputeHandler nextHandler) {
        this.nextHandler = nextHandler;
        return this.nextHandler;
    }
}
